﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PlayingCardRandomSort
{
    class Program
    {
        static void Main(string[] args)
        {
            Random random = new Random();
            List<Card> cards = new List<Card>()
            {
                new Card((Suits)random.Next(4), (Values)random.Next(1, 14)),
                new Card((Suits)random.Next(4), (Values)random.Next(1, 14)),
                new Card((Suits)random.Next(4), (Values)random.Next(1, 14)),
                new Card((Suits)random.Next(4), (Values)random.Next(1, 14)),
                new Card((Suits)random.Next(4), (Values)random.Next(1, 14))
            };

            Console.WriteLine("Five random cards:");
            foreach (Card card in cards)
            {
                Console.WriteLine(card.Name);
            }

            cards.Sort(new CardComparer_byValue());

            Console.WriteLine("\nThose same cards, sorted:");
            foreach (Card card in cards)
	        {
                Console.WriteLine(card.Name);
	        }
            Console.ReadLine();
        }
    }
}
